// pc/05my/gotOrder.js
var co = require('../../js/common.js')
var _this, app = getApp()
Page({
   data: {
      orderList: []
   },

   onLoad: function (opt) {
      _this = this
      var param = { unionid: app.aData.userInfo.unionid }
      if (opt.id == 1) {
         wx.setNavigationBarTitle({ title: '我接中的订单' })
         param.get_status = 1
      } else {
         wx.setNavigationBarTitle({ title: '我争取的订单' })
      }
      co.getSelfApi('order/Get/myGotOrder', param, function (res) {
         _this.setData({ orderList: res.data })
         console.log('【输出_this.data】', _this.data)
      })
   },

   toDetail: function (e) {
      var order = this.data.orderList[e.currentTarget.id]
      wx.navigateTo({
         url: '/home/04order/detail?order_id=' + order.order_id
      })
   },

   onShareAppMessage: function () {

   }
})